package net.elbandi.pve2api;

import java.io.IOException;

import javax.security.auth.login.LoginException;

import org.json.JSONException;
import org.json.JSONObject;

import net.elbandi.pve2api.data.*;
import net.elbandi.pve2api.data.Storage.Content;
import net.elbandi.pve2api.data.resource.Vm;

public class main {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws JSONException 
	 * @throws LoginException 
	 */
	
	
	
	public static void main(String[] args) throws LoginException, JSONException, IOException {
		// TODO Auto-generated method stub
		JSONObject data = new JSONObject();
		JSONObject dataS = new JSONObject();
		
		Pve2Api pv = new Pve2Api("10.20.2.10","root","pam","iaas2013");
		System.out.println(pv.pve_hostname);
		pv.login();
	/*	data.put("id", 200);
		data.put("type", "qemu");
		data.put("name", "MyVm");
		data.put("cpus", 1);
		data.put("vmid",230);
		data.put("node","iaas-be");
		data.put("maxcpu",2);
		data.put("maxmem",1024);
		data.put("maxdisk",1024);
		data.put("uptime",30);
		data.put("cpu",1024);
		data.put("mem",1024);
		data.put("disk",1024);*/
		 
		//Vm rs = (Vm) Resource.createResource(data);
		
		
		
//		data.put("cpu",1024);
//		data.put("cpus",1);
//		data.put("disk",1024);
//		data.put("diskread",1024);
		 /* 	data.put("node", "iaas-be");
    data.put("vmid", 102);
		data.put("ostemplate", "local:vztmpl/ubuntu-10.04-standard_10.04-4_i386.tar.gz" );*/
		/*diskwrite = data.getLong("diskwrite");
		maxdisk = data.getLong("maxdisk");
		maxmem = data.getLong("maxmem");
		maxswap = data.getLong("maxswap");
		mem = data.getLong("mem");
		name = data.getString("name");
		netin = data.getLong("netin");
		netout = data.getLong("netout");
		nproc = data.getInt("nproc");
		status = data.getString("status");
		swap = data.getLong("swap");
		uptime = data.getInt("uptime");*/

		
//		VmOpenvz vz = new VmOpenvz(data);
//		pv.createVm(vz);
	
		
	
//		System.out.println(pv.getResources().toString());
		
		
		
		
		

	}

}
